<script setup>
    import Sku from '@/SKU/Sku.vue'
    import {ref, onMounted} from 'vue'
    import axios from 'axios'
    const goods = ref({})
    
   async function getGoods() {
    // 1369155859933827074
    // 1135075 
        const res = await axios.get('http://pcapi-xiaotuxian-front-devtest.itheima.net/goods?id=1369155859933827074')
        goods.value = res.data.result
        console.log(goods.value)
        
       
    }
    
    onMounted(() => {
        getGoods()
        
    })

    function skuChange(sku) {
      console.log(sku);
    }

    
</script>

<template>
  <Sku :goods="goods" v-if="goods.specs" @change="skuChange"/>
 
</template>

<style scoped>

</style>
